Docblock clean up

No functional changes--just adds docblocks, and adds build dir to .gitignore, adds test coverage, and cleans up some control flow.
wrong type ;) should be `string[]`