Refactor wrapping of class based views (fixes bug #6)