Annotations filter by viewport

Implementation for #540 and related minor improvements.
If you replace this with ```TOOLTIP_DEFAULTS``` (it should be the same object with same data) it miraculously doesn't work (doesn't create a tooltip).