errorlib: improved printing of exceptions/errors
- During register_exception(), print also the values of local variables in the stack trace.
- Do not print very long dynamic variable values (such as prefix) as such, but truncate them to maximum 500 characters only. This fixes voluminous bibrank math exception emails.
- When sending error messages via /error/send, escape all form template variables properly.