Factorizes playlist dict creation by using common function to_dict(playlist)

Some vars renaming.