Unescape the values of html attributes (#612) + refactor some common bits of the parser