Use shared_ptr for storing tracks.

Significantly reduces memory usage.