refactor events and helper functions to their own files
Fix OptDeps / X-Embedded
Fix dry-coding, sorting
Merge branch 'refactor' into dev
fix timers + some shipment events
fix tooltip close/expand
more cleanups and fixes (tooltip, shipment detection magic)