Describe timestamp in rules heading better

It used to just say 'Applied'. Now it distinguishes betweet 'Created',
'Modified', and 'Used'.
Fix bug in activity top_friends query

It used to count activities without friends as an entry for 'nil'
friend.
Add sort by to rules#index