Merge patches from rezor92@googlemail.com:

[~] Use ctorrent instead of unworkable
[~] Allow specification of custom SQL credentials
[!] We now use a local copy of writer.pl as a template (for db credentials)