Feature: datastore query order

This PR carves off the 'order' portion of #126, and adds tests for it.