added a command line test script. Minor changes accompanying it to make it work nicely