some basic utils needed by the tag string generation

`escape_attr_value` escapes html attribute values so they can safely
be added to the tag markup string.

`hash_attrs` takes a hash and converts it to a string of html attributes,
accounting for nexted arrays and hashes.