Changes requested in the last pull request. 

@voz @vohtaski Can you please review my code.

-indentation, refactoring, rework conditions, use cdn, add a modal confirm dialog when adding an activity, isolate the code in an anonymous function (I will do that better later with an app global variable as you told me...)

-the updated gadgets are still available on http://aubry.cholleton.free.fr/activity_streams/ . I tested them and everything seems to be still working with these improvements.