Adding a test for the scalding repl

Also includes some refactoring of the shell scripts to avoid duplication of code.