My very nasty attempt to quickly turn this into a RequireJS module. Basically just wrapped the entire thing in define()