Main method for calling library from command line.