Create a generic tooltip type within the module to make the overall thing easier to grok.

* Prevent tooltips from being closed prematurely if it replaces an old tooltip.
* Add a "done" callback to the dom-jquery animation functions.
* Use the done in the tooltips to work towards the goal of remove direct jQuery calls.
Make sure fadeOut passes the done callback to the jQuery equivalent.

Make sure stopAnimations calls jQuery.stop
Further cleanup on the tooltip code at @seanmonstar's suggestion.

* Move animateTooltip into the Tooltip prototype.
* Clean up the tooltip singleton logic to be easier to follow.
Some further refinements to the tooltip code.

* Instead of using the BrowserID.Tooltip.shown variable for tests, add the BrowserID.Tooltip.visible() function.
* Everywhere that relied on BrowserID.Tooltip.shown directly has been converted to user testHelpers.testTooltipVisible()
* Add a test to check whether tooltip contents are escaped before being added to the DOM.
* In the tooltip code itself, turn the magic numbers into constants.

Thanks for the suggestions @_6a68!
Merge pull request #2930 from shane-tomlinson/issue_2762_tooltip_cleanup

Create a generic tooltip type within the module to make the overall thing easier to grok.

@6a68 gave an r+ with caveats. I added one more commit to address those caveats. Merging.