implement test for getCursorOffset()
rename document into delegateDocument
add test for getLineOfOffset()