Refactor GetEntities to take an options object instead of having so many
parameters.
Make paging work when not using the id field as the sort.