fix and refactor(date.js) compatibility with angular 1.3

This refactors the date parsing to allow it to be used in the ui-date
directive.

Breaking Change the blur event isn't fired.  This can be added back when https://github.com/angular/angular.js/pull/9808 is merged