Improved Agenda

* Now support for habits & REPEAT_TO_STATE property
* Improved serialization
* Added more apis for time type.
Updated for Agenda

* Fixed error for changing todo states & rebuilding agenda leading to no
  deadline available anymore. Added guard to instead try to use 'closed'
  time if available.