Refactored the model and table view data source.

Got rid of unnecessary classes.