Add support for different output formats.

Console formatter for "pretty" output, as well as retaining JSON. Output
is now redirected to the console instead of a file. Output can be
redirected to a file using the shell.

Also tidied up some of the formatting for pep8 checks.