Fixed protectedness of note events
Performance improvements.

Removed excess locks.

Inlined common ringbuffer calls.

Changed scheduler to use priority queue instead of map. This moves a small
burden of work to enqueueing, with a massive gain in speed for removing, which
is run far more often.

Testing on my laptop suggests this gives a 30% speedup overall
Merge branch 'master' of github.com:thenyeguy/ClickTrack