Refactored Granularity class.

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

Refactored Granularity class.