Reworked the library to be more modular using RequireJS for the dependencies and loading