Design and optimization of a modular setup for measurements of three-dimensional spin polarization with ultrafast pulsed sources