Footer logic moved to a nested layout

Moved the basic layout (without the footer) to _BasicLayout, and moved
the footer stuff into _MainLayout