Work on layout code and settings handling:

 * Default settings are stored with main and each module
 * Modifications to the settings are diffed with the defaults
 * Settings can be modified by passing objects or functions
 * All layout code is now in layout.js