Fix the parser for the % char; simplify a bit and add tests
Use sets