Updated lib, command line application, and cmakelist files

Please merge.