Made filewriting operations to its' own service for easier testing. Also added some tests for playlistadding.