The whole way that we do Javascript in Studio is about to change when #662 lands. This is going to need to be refactored into proper AMD modules to work with require.js.