Flesh out Cursor implementation, and add tests