Add require.js, modularize some stuff