add exit codes and fix test script
Merge pull request #11 from michaeltchapman/fix_testing

add exit codes and fix test script