Add distinct error classes

closes #2690
- added new error classes
- moved errorhandling.js to /errors/index.js
- changed API errors to use new classes
- updated tests
Merge pull request #2704 from sebgie/issue#2690

Add distinct error classes
Move mail api to json/api format

Fixes #2650
* rerouted all mail sending to api/mail
* changed request and response formats to json/api-like structure
* tested with forgotten password and new blog email