Updated library to make it modular, added main.js for an example usage. Updated readme.