General cleanup

A bunch of misc cleanups to make admin tools easier to subclass.