Fix ability to sort by case owner

http://manage.dimagi.com/default.asp?121159

best reviewed commit by commit.
Should be possible, will take a stab at it: http://manage.dimagi.com/default.asp?122237