Add tests for FtpInputStream

And fix some bugs along the way!