media and story changes now logged to "activities" table
order JSON keys alphabetically, just like Perl's JSON module does