Converted to class-based views.

There may be some brokenness, tests will be coming soon.