Convert javascript to use requirejs to load dependancies

I'm a little concerned about the role of singletons in the AMD model,
and how to carry state around. I feel like there's two ways I'm using
AMD at the moment: one to return a new class (base64, commentState) and
one that returns the same instance (prmebro, eventListener).

I've had to make some considerable changes to github.js, which is fine.
I've already started to change it to add subscribers, so completely
forking it isn't an issue.

I made a shim for base64 because I've not touched that code, and it can
still be easily updated by just copy and pasting an update version in
place.