Change summarize by month

- add unit test
- add new function to get timeunit from offset
- change summarize to group by real month when alignFrom is false. It
  introduce a dynamic bucket and interval. So the interval can now be an array