fix(debounce): use  for deferring tasks

I've completely rewritten debouncing function for binding it with `$timeout` service from angular core.
Now there is no need to call `$scope.$apply()` inside debounced functions.
Moreover, you can now write synchronous tests, which does they more cleaner