Refactored Exceptions

I'll need to do a little more testing before you merge this. I haven't actually checks this works yet.