Log error backtraces

Resolves #46