Device playlists & two-way sync

Thomas,

Here is the (latest) pull request, after rebasing back onto your master branch. Thanks!

Joseph