Refactoring to Support Mocking

We need some mocking, and we need some cleaning up. 'Nuff said.