Add a TON of metadata speed / memory fixes and improvements, courtesy of @crast