Require.js (WIP)

Opened so people can spy on me.  Please ignore random code snippets sitting in files they don't belong in (especially in notebook.js), I'll move them when I get to the correct file.
Any particular reason this top-level variable was moved to an instance variable? To minimize changes in this PR can it be put back?