Basic support for link queries

This PR adds support for link queries - see issue #617. The core library does not support:

* queries on binary data (`NSData`)
* case insensitive queries on strings (`NSString`)
* predicates `BEGINSWITH`, `ENDSWITH`, and `CONTAINS` for strings

@alazier @jpsim @bmunkholm 
Rather than inserting ```if (!isLinkQuery)``` for every statement for the rest of this method, perhaps we should split this into two methods/control flows and only do this conditional once. Would make it easier to read and less error prone.