VID-1786 Implemented tracking for galleries and slideshows

Understand JS so much better now ...
Don't forget that the js coding conventions are different than the php ones. We don't put extra whitespace inside of parans. Also, jshint complains about not using strict comparison operators (=== and !==). Those should probably be updated as well. You can actually enable jshint in PHPStorm to lint your code as you're writing it. It should be under preferences->Javascript->Code Quality Tools