Add cursor handling to datastore.query.Query.

This PR carves off the 'cursor' portion of #126, and adds tests for it.

Manually apply diff from Tagtoo-master:

    25672e10fc359c67e0d267db2f23928b0a5761ca^..
    90ac07db1bcd3ebfd89f43ee9b59ded1cd8dd643

Add unit test, fix bugs.