added saver to Trajectory and a unit test for it