Added removal of extraneous whitespace to metadata items.

This stops validation issues caused by metadata items being composed of only whitespace e.g. Title