Improving in-source documentation

Did it in JavaScript, since most people will be using that.