Added playlist.js to example.html
Cleaned up playlist sorting functions and wrote tests