Adding comments for js, cleaning up and putting final touches on code base