Javascript optimization

This PR looks massive, but its not. I re-did all the history of my changes because my [test branch](https://github.com/DeuxHuitHuit/symphony-2/tree/collapsible) commit were not meaning full.

I played a lot with the js while attempting to fix some problems with @nilshoerrmann's datetime and I kind of set a bounty to myself to solve 6d70e19 (it took me like 10 hours to figure out and the fix is 4 chars...)

I also did a lot of timelining in the dev tools and regression testing.

Hope you like it... I really put lots of effort in it.
Well, I was looking for a name and went with bootstrap's name: http://getbootstrap.com/javascript/#affix But I would not mind renaming it (I am not a native speaker either) @brendo @designermonkey @psychoticmeow You guys speak english as you primary language: what should we call it ?