minor cleanup like line length, spacing, phpdoc
switch to class architecture

hopefully no one was calling those hum_* functions directly.  Not
likely, since all of the interesting integration points had formal
hooks, which this commit doesn't change.