add gotoLocation for credocument

This patch also fixes #317.