Refactored javascripts
Implemented last element of the java-javascript puzzle...