Enhanced API documentation

Here are two of the js files which I audited and added some docs to. Is this what you are wanting? I am not the best at documentation so please feel free to say no.