DOGE: Towards Versatile Visual Document Grounding and Referring