Store ProjectTotal data in database

Closes #466.
Added.