experimental macro support

Please use `getAnnotationIterator(offset, length...)` whenever possible. There can be 10'000 annotations in a document, and linear search might get slow (not sure how often this code is executed, but if we can save some cycles while working in the editor, it's great.