Cleaned up a bunch of code.  More to do, but this is a move in the right direction.