Completely refactor measure tools

See #142

This PR:
* Gets rid of a lot of global variables which were hanging around in the the DOM
* Creates a complete method for the measuring stuff
" Avoids to use pure DOM handling methods (but uses Ext instead)

Please revirew