Josh

Some style, a couple features, and a lot of refactoring.