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)
Are there any good tools yet for just rewriting the code based on a style guide? Code painter sounded promising at one point.