Made some changes to playlist saving code

Specifically, I broke it a while back. I really need to start using unit testing... I fixed the bug, and also implemented CSRF protection for when multiple user support is added.