Update to AMD

Change app.js and configuration (defaultConfig->config) to AMD modules.