reversehash to accept a hash and return a hash where the
roles of keys and vaalues are reversed. that is the key of the
key of the input hash becomes the value of the output hash.
if there are more than one keys in the input hash has
the same value, they are connected by the symbol '|' in output