Improve how we traverse the DOM
I think we need to eventually do the following across the whole codebase:
- use
querySelector
when we just need the first match - use
node.querySelectorAll
instead ofdocument
- always cache the result to a var
These might be micro-optimizations, but they should definitely help with large DOMs.