Make TDL work with require.js

I hope this doesn't break anyone. I tried to make it so it works
both the old way, including `tdl/base.js` and then using `tdl.require`
as well as working the new way, which is to include `require.js`
and then use require js style `define` in each module and `requirejs`
in the main code.

Ideally it seems like it would be good to change TDL to use the
require.js style where there are no globals but that would break
a bunch of code.

TDL currently has 2.5 globals. 'tdl', 'gl', and 'goog'.`goog` is
only there for the Closure compiler. A few things are marked as
`goog.typedef` which tells the Closure compiler you're defining
a type. I don't know that I care about that anymore.

I could potentially make tdl/base.js include all tdl stuff without
globals and wire them all up to the `tdl` global. That would make old
code work and clean up for the future?

I could just fork TDL. I have no idea how many people are using it.
Not many I think. I don't know. I just wanted to use TDL in another
project where I started using require.js and tdl's use of `tdl.require`
seemed to be causing issues.

Maybe I should just start over. There are things I'd change if I was
to start TDL over. All the stuff related to context lost I'd get
rid of or move somewhere else. You can only reasonably recover
from context lost if you're tracking all resources. That should
happen at a higher level.

If you have an opinion speak up.