JSDoc updates, if statement cleanup

First pass at doing some JSDoc cleanup, as well as cleaning up two code branches.

Will require more work for specifying callback arguments.