Refactoring

Big rewrite of both backend and frontend to reduce complexity.
Fix duplicate dates in line graph data
Fix duplicate dates in line graph data
Merge branch 'dev'