moved logic from main to level6

implemented json flag and output with single-lines by default

updated readme to reflect changes