added --json flag;

Added a flag to print the output as json so it can be used along with
other languages. Still not functional though.