Query tuning for the expire / delete selections + cosmetic stuff.
Merge pull request #69 from crawley/master

Fix for slow delete / expire