Fixed some remaining problems with the merge
Cleaned up some of the layout code, and added the functionality for session management throughout all of the new changes