refactored code, added support for M3U playlists, and added more command line options