build: Refactor requirejs dependencies and build

- Support for multi-pages configuration: common libs are
loaded by common.js, main.js will load only main specific
modules.

- Added build configuration for optimizer, run
	npm run-script build
to generate optimized/minimized version in static-compiled

- When run in production environment, optimized version
will be served automatically:
	NODE_ENV=production npm start