Modified the code format (braces on the same line, like in Javascript).
Some methods (e.g. load and unload) are now asynchronous and make use of promises.