Database implementation on HealthMetrics

Basically adapted all the activity stuff over to health Metrics.