Cleaning in require.js code

Plus merging with master.