Support using empty query to get all documents

It turned out that f3499c2de3247900ee1c660b8f0014f8ad9aeee7
allowed empty queries to return all documents by a piece of
luck rather than judgement.

This commit also fixes -find to return `nil` if it's passed
a `nil` selector.

Fixes #15
Use block-based enumeration to return results

This paves the way for more efficient skip, limit and unindexed
post hoc matching. Particularly for the latter, it should make it
simpler to only run the post hoc matcher on the minimum number
of results possible, rather than all the results as we currently
do.
Fix crash when querying with no indexes defined

This is a bit of a hacky fix. Ideally, we'd always have an index
defined over document ID, but it seems like an overhead to do so.
For now, therefore, fail.
Add tests for stopping enumeration over query results
Merge pull request #35 from cloudant/32-enumerateResultsUsingBlock

32 enumerate results using block
Upgrade logging to be compatible with CocoaLumberjack 2.0.0-beta4

Upgrade logging marcos to work with CocoaLumberjack 2.0.0-beta4. Beta 4
is incompitable with beta3 as a result the podspec is updated to rely on
beta 4. It is pinned to beta4 to avoid unexpected breaking changes.
Merge pull request #36 from cloudant/cocoalumberjack_beta4

Upgrade logging to be compatible with CocoaLumberjack 2.0.0-beta4
Incorrect enum used in logging macros

Incorrect enum (DDLogLevel) was being used for CDTQ logging macros,
this comments corrects the enum to be DDLogFlag
Start CDTQQueryValidator

Start work on creating CDTQueryValidtor, removing validations from
CDTQSQLTranslator
Moved to validations in CDTQQueryValidator
Fix issues with validation

Fix issues with validation where valid queries were being rejected
and invalid queries accepted.
Add validation for child nodes.

Since a Query node should have children, if it has zero children it
has encountered an error generating the tree, in this cicrumstance
the query should be aborted and nil returned.
Commit so I can rebase
[WIP] first pass at validation
Finish first pass at validation

Finish first pass at creating tree walker for
validating the normalised query