Added JCommander to handle command line args. Make compatible with Java 6 (from 7).