Add tests for scp
Fix bug in scp

When uploading a file with a linefeed in the first few bytes, scphandler
would crash. Now it wont.