Added docstrings
Moving js to separate files
Applied module pattern to js (just because)