Fix the urlencoded parser to not add an empty key pair when given zero-length input. Tidy up. Add tests for the parser.