Moved the code that messes around with the query to add the fuzziness into a new parseQuery function, to reduce the size of the main function.