Basic support for link queries

This PR adds support for link queries - see issue #617. Only queries for objects linking to one other objects have been implemented and tested. 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