Finished basic refactoring.  Now I'm creating the "database recording" infrastructure.