Convert generic function based views to generic class based views

Replace deprecated function based generic views with class based generic
views.