Tidy up filter.order parsing

/to @ritch 
Once we have time, this code will be refactored into the base SQL connector.