Adding directory opening and playlist sorting

Here is the trial code for directory opening code, that also adds support for playlist sorting in the backend. As per mpv-player/mpv#362