Feature/error prototype

And oldie I had in my queue, freshly rebased on recent changes:

Closes https://github.com/geraintluff/tv4/issues/81