Exceptionhandling

Added exception handling to basically all places which could throw (at a high level of course). Also have exception code to try to recover from most exceptions, albeit in a destructive manner.