Implement IN and BETWEEN for link queries

Added some more tests for link queries and it turned out that I missed that link queries need an entirely separate implementation of them from normal queries.
Does this actually improve performance? I would think any improvements would be inconsequential when compared to the amount of time spent subsequently executing the query.