Add sort/limit to memory/file cursors
Merge remote-tracking branch 'origin/master'