added require.js; reorganized