Add utility function for returning json error messages
Add utility function for returning json error messages

In Texcavator error messages are communicated to the user interface by
sending json objects containing the error message. To avoid repeating
the creation of these error messages, a utility function that returns
custom error messages was added.

It seems that in the interface, error messages are not always accessed
in the same way (e.g. field error instead of msg). This still has to be
updated.

msassmann/texcavator,UUDigitalHumanitieslab/texcavator,msassmann/texcavator,msassmann/texcavator,UUDigitalHumanitieslab/texcavator,UUDigitalHumanitieslab/texcavator,msassmann/texcavator