Added removal of extraneous whitespace to metadata items.

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