Added recording of track metadata and generalize trackPlotter