Moved DrawView to its own file and added database code

This is kind of a big change, I apologize if I've overwritten anything by accident again.