Added commandline functionality to make testing easier.