Performance improvements

Only render document when text changes, not on each cursor movement.