Added code to write sources as well as preferences
Merge pull request #67 from TimSimpsonR/write-sources

Added code to write sources as well as preferences