re-wrote most JS code without Ember, but with require.js