More changes to db.py to allow avg hash_rate, machine dashboard view/controller, v1