Initial sketchy implementation of ordering in queries, currently only
applied to the individual item history.