Fix gentoo pkg

Fixed up gentoo related code so pkg.install still works and supports the new pkgs with versions state format that @archtaku implemented