Added measurement tool

Refactored popover stuff to _PopoverMixin.

Closes #148