Lots of changes.

Introduced layouts with Freemarker.
Refactored the way requireJS scripts are loaded.