add config option for rankings feature
touch up code a bit
touch up code a bit, simplify some odd queries