Refactorized whit metaprograming and fix loading

now you can call

*  Object.count_by_day
*  Object.count_by_month
*  Object.count_by_year