Annotations filter by viewport

Implementation for #540 and related minor improvements.
Here, it works, but on the other end, using ```TOOLTIP_DEFAULTS``` fails. I'll add a line comment there.