More detailed error reporting for UnknownErrors
Add after hook

This hook can be used to execute some code after the last state. Can be
used to close some paired actions (i.e. mouseUp/mouseDown) without
taking screenshot.
Use wd from fork