Refactor SearchParameterParser#filter method

Break the logic into small chunks that do one thing at a time to the
input data and gradually convert it into the right form for output,
and add the appropriate entries into `@errors` and `@used_params`.

These chunks would be suitable for extracting into separate methods
rather than leaving them all in `filter`.