Refactoring this file a bit to allow for easier move.
Moving wrangler/events to topotools/events.
Moving more code from wrangler to topotools.