refactor(datepicker): fix code organization and performance

* Add `datepickerService` to hold common functionality.
* Remove `$watch` for `mode`.
* Use integer values (intead of strings) for `mode`, inside the directive.
* Do not create new Date objects if not necessary.