Starting to refactor js code
Merge pull request #4 from MichalPaszkiewicz/master

Starting to refactor js code