Add proper playlist support, fix repeat bug