Make Datatable a class instead of a module

Do this by injecting all the dependencies it needs, and by building more stuff in the controllers.