Reworked the layout functions

Took layout functions out of the engine and into the layout class
Cleaned up functions for easier looping