Cleaned up the code, added changes to docs and minified javascript