removed unnecessary group_by_date function and fixed a syntax error
created better to_dict function
using date range everywhere
Merge pull request #23 from ajy/refactor

Refactor