Abandon the use of $window

It would be better to make moment() function injectable one time instead of finding it in $window every time.
Moreover, I've used $timeout instead of raw $window methods.