Js patches

Great project! It came up on my 24PullRequests dashboard :smile: 
I've made a few amends to the JavaScript section committed each small feature individually for your review, submitting all as one PR.