Less controversial code quality check.

Change pattern that are prone to error, like function redefinition
and other.

Same as #7216  but twice smaller. 

I stil believe we should do something like that sooner than later as the huge disparity of code style make it really difficult to use tools like jshint that report hundreds of potential mistakes. 

If this is still controversial, I can do almost each fix independently. 
but `_action` (to which btw, I should add an s) is an object, not an array, so `[].forEach` wont work, and even if `$.map` would work, it's behavior is weird and unnatural.  I can wrap in a an if hasOwnProperty if you like.