Add cursor position to json serialization