JSDocs, formatting fixes, and a little variable name refactoring.