Repository.xs: Refactor checkout code

Added git_hv_to_checkout_opts function which may be used
by other code paths that need to interpret checkout options
i.e. merges.
Reference.xs: Allow target() to take a new target
Reference.pm: Updated target() documentation
Changes: update