Moving process exit to script interface and adding tests for exit codes

as well as asserting errors bubble up so that it's easier to ensure correct behavior for issues like #12.