Switch to class based views.

Closes #5.