Adding a test for the scalding repl

Also includes some refactoring of the shell scripts to avoid duplication of code.
The returned exit code is actually still 127, as set in the commons script.