Change a few functions to be come methods

These functions clearly needed to be methods of TrajectoryOfSamples, the
other change taking place is explicitly returning `this` from the
constructor.