Stable sort preferences of same quality according to client order

fixes #22