Code cleanup.

* Fixed the remaining two JSLint errors.
* Added some comments around functions, including the new positioning strategy