Add global error listener.

Closes #31.
Merge pull request #37 from square/jw/global-error-listener

Add global error listener.