Added file transfer support

I added a functional implementation of file transfers. It still lacks gui in chat window but otherwise works fine.