Moved creation of tails (in 3d) to a tail class.