Refactored Granularity class.

Signed off by: Diego Araújo <diegoamc90@gmail.com>
Merge pull request #50 from mezuro/granularity

Refactored Granularity class.
[WIP] Working on periodic_processing

Signed off by: Diego Araújo <diegoamc90@gmail.com>