Moving away from command line interface.

I don't think this code will be very useful from the command line. It will most likely be used within the framework of a larger application.