Removed some debug statements
Added flags. Fixed --packagejson. Cleanup.