Added requireJS wrapper and no longer writing to window directly