Basic implementation of layout management
Added compile directive
Added state logging
Added compile spec
Separated common and application layout logic