Fixes #135.

Added options for configuring behavior of promises.

Fixed test to work with older version of angular.

Improved promise error handling.
Merge pull request #141 from jmdobry/fix-promises

fix-promises