Add API docs for every method on index.js

Originally the branch was intended for something else, so never mind about it.

This PR updates inline API documentation for later [yuidoc](https://github.com/yui/yuidoc) or [dox](https://github.com/visionmedia/dox) or whatever.