Generalized reporting functions. Included command line parsing.