require.js overhaul + bug fixes