Reimplement parser for html5lib test data without LPeg