Error handling, test expansion and general fixes

This pull request expands error handling and error logging based on discussions with @sbesson. In the process of this expansion various issues with the test system, documentation and file handles were noticed. Attempts to correct these issues are also in this PR.

All unit and integration tests currently pass and run to completion with `ulimit -n 1024`. We are still leaking `PIPE` file handles somewhere. I will be attempting to try and find out where that is and fix it as part of this PR. In the mean time it should be considered open for testing and review.

/cc @joshmoore