VE-1477: Hide selection and context menu while Template dialog is open

We should only do this if we don't have rects cached as it's relatively expensive. Said cache should be cleared when the document transacts or surface position is called, but those events are currently only bound when the highlight is visible. Those need to be bound on setup, and the clear the cache every time, and redraw the highlights only if it's visible.