Replaced currentTrack and nextTrack with indexes.
This allows us to have teh same track appear any number of times in a playlist.
Also tidied up source code.