Docblock clean up

No functional changes--just adds docblocks, and adds build dir to .gitignore, adds test coverage, and cleans up some control flow.
this change should be reverted.