Add util files.
Add error checking on run.
Code cleanup.
More stringent error checking.
Squash warnings.
Merge pull request #69 from billbindi/master

Utils added and error checking