Fixing file upload.

Fixes #248.
Added initial work on TCP networking. Sorry, I messed up the git history...
Added necessary stubs to native_methods to prevent undefined errors
Replaying previous work on branch