Adds test of period resolving in stats

 - Also fixes default values for period selector in frontend
 - Adds tests for graph data preparation