Dump errors to $stderr on the server side

Currently it is difficult to identify the source of an error in server-side code. This commits writes backtraces in a familiar format to $stderr, making it easier to locate the origin of server-side exceptions.