More reorganization

- added comments
- changed 'mediaIndex' to 'segmentIndex' to be clearer
- moved playlist specific functions into their own file
- removed a now unneeded test (relates to videojs/video.js#1350)
A lot of these functions were file-scoped because they were intended for internal-use only. I don't see a lot of harm in exposing them but I don't think they're written to be general-purpose utilities.