support requireJS-like module definition

in order to load this library as a module using requireJS, this code is
needed.