Revert "Refactoring to move code to right locations. Attempt at breaking dependency cycles."

This reverts commit 58819b4dcc697f63872bee9f3ddd41a0c4d8fca5.
51 files changed