Add error formatting option

Before this there was no way to control the output of error messages, resulting in a long stack trace. This allows the use of a custom error formatter using a --error_formatter= argument.