1. Remove unused source code from MediaSourceImpl
2. Made SortMode more robust