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 
We need to throw an exception if count > 2