Move pairsToMetadata and makeMetaData to HtmlHelpers.

Now that I've gotten rid of this duplication I feel better about myself.