v0.7.7 Moved DB functions, Enhanced profit report

Moved DB functions to a separate module and enhanced profit calculation to persist through application restarts.