Reformatting directories, adding History tab.

Decided to break code into UI and DB related sections. Added all of the
code in for the HistoryFragment. Added some test stuff.