Fixed bug that prevented org data.json files from being created, refactored the code, reduced to single main() function and added conditional main() invocation when running from commandline, added ability to supply the output dir, added fallback that when data.json found at localhost/data.json, that it will fallback to localhost:5000/data.json (useful when testing with paster vs live apache served content)