Cleanup. Added basic JSON output.