A nice fat refactor in service of a smoother deploy process. Also fixed a number of vexing issues as they arose.