Added gflags for command line flag parsing, minor changes, cleaned up makefile.