[cleanup] Run clang-format over these routines to remove formatting
differences from subsequent diffs, and ease review. Going to be
performing some major surgery to simplify this stuff.