Develop housekeeping

A whole bunch of minor housekeeping for the develop branch.

Lots of formatting fixes, docstrings, minor linting, and a few larger refactors to move private functions into utility modules.