Proper profile sorting.

Fixes #259

Also better property_details cursor hygiene.
Merge pull request #263 from MastodonC/feature/profile-sorting

Proper profile sorting.