Set up files to use RequireJS
Add fix to avoid console errors

Adapted from Twitter source code.