Updated script to deal with third party functions

As a workaround to accessing other functions via the window property it
made a lot more sense to have an element that already had the
functionality attached passed in along with the moments array. That way
I can just trigger a click and it follows that everything should work
fine.

That being said, eventually the script is going to have to deal with
just taking a collection of elements, thinking just a collapsed and
expanded element. This would make it a lot more customisable for end
users, they could just develop their own tooltips and pass it directly
into the script using a parameter. Probably best to keep the simple
functionality though for quick setup (ie the tags for the title, then
expanded element for auto generation)