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 PR #31.