added require.js and re-structured js setup