Searchlogic working

Might need some refactoring at some point.
Next up: SqlQueries