Backout of Backout of 714f5b1 for now.
... or would that be back-into 714f5b1?

714f5b1 - Move history contents filtering logic into model.

Filtering for deleted, visible, and ids with ORM should prevent loading unneeded objects into memory (a history with 1000 items and 5 visible will now only cause 5 items to be loaded instead of 1000 just to filter out 5). Simplifies history_contents API logic somewhat, allows easier 'unit' testing (included), and provides a clearer entry point for additional 'showing' additional contents types (read dataset collections).
Fix history contents ordering broken with previous changeset.
Add stronger test cases, though these are still insufficient to exercise the error. The only way I was able to get the history contents to come out misordered was to use postgres. Nonetheless, using postgres this now orders datasets properly.
Merged in jmchilton/galaxy-central-fork-1 (pull request #289)

Move history contents filtering logic into model.