Optimized code.

Added long form options.
Added ability to specifcy directory.
Added command line help documentation.