Use $timeout instead of safe apply, closes #1.