Fixes #135.

Added options for configuring behavior of promises.

Fixed test to work with older version of angular.

Improved promise error handling.