Updated updateMetadata. Added better argv parsing to index.js.