add formatter to print out stack traces

replaces #464