Update metadata upload to new key value pair format. Fix many bugs after change.