default to server_date in action sort if not submitted by the same user

also adds and touches up tests

this is a workaround for http://manage.dimagi.com/default.asp?149884

easiest read commit-by-commit
everything from here down preserves the old behavior