Design, optimization and initial performance of a toroidal rf ion trap mass spectrometer