task engine, support for limit and sort order on datastore queries, fixes #180