Refactors, add test cases.

Made diffHoverData() static.

Added test cases to tests for getCurrentlyHovered().

Adjusted D3 defs file: See https://github.com/borisyankov/DefinitelyTyped/pull/2989.