The eRHIC spin rotator and the beam optics of the 400 MeV transfer line to RCS