Allow sorting results using a single index

This commit adds a simple SQL-based sorting
implementation to CloudantQueryObjc.

The user specifies a sort document:

[ { fieldName: asc }, { fieldName2: desc } ]

The implementation looks for an index containing
fieldName and fieldName2, failing if one isn't found.
It then generates a SQL query to get the ordered
doc IDs:

SELECT DISTINCT _id FROM idxtable ORDER BY
   fieldName1 ASC, fieldName2 DESC

It then loops through the results of the sort
query, adding each docid which matches the
user's query to an array, ending up with a
list of the docids which match the user's query
in the correct order. Skip and limit are then
applied.

This isn't efficient, but works for all result set
sizes.

Fixes #9.
Fix using offset and limit where limit goes beyond array bounds
Use consistent validation of sort and field documents
Merge pull request #18 from cloudant/9-sort-results

Simple sorting implemention
Add projection, skip and limit docs
Serpate tests out
Add array comparision tests and create indexes for documents
Abort query when compound operator does not have an argument of NSArray
Abort query when compound operator Array does not only contain dictionaries
Bail from query when argument dictionary to operator is empty
Rewrite processing loop to validate then process
Add comment to why dictionary is being passed back
Change error message
read file for invalid syntax
Re add files lost in merge