Webfrontend errorhandler

This contains a skeleton for a new way the webfrontend handles error. Use this skeleton instead.
To continue work, I will create several issues (some of them are also handled here).

All commits before "changed the way the webfrontend treats errors":
Closes #857

"changed the way the webfrontend treats errors":
Closes #792
Closes #861

All commits after "changed the way the webfrontend treats errors":
Closes #851
Fixed some severe bugs in error handling