Added tests for hookCommand
Slight changes based on feedback

* defer restorer()
* slight change to error message checking
Merge pull request #459 from gabriel-samfira/context-tests

Added tests for hookCommand

This PR fixes a small bug on windows and adds more unit tests for the uniter.
ActionResult refactor