Refs #568 - Inherit the parent framework error function

The error function also needs to inherit parent error function so we get things like validation errors appearing.

Even with this change, if a validation error occurs in a form in a modal, the modal will disappear and an alert containing the XHR response displays. This is obviously not a good thing. I'm not sure how you'd solve it.

This PR at least gets the validation error displaying and adds support for all the error-related stuff framework.js currently supports.