Complete rewrite

Now avoids conflicts with other mouseup events on the window node