Ns predicates support for queries

Opening a pull request for merging NSPredicate query support into Sync.