Make shared library instead of module.

Fixes library loading on Mac OSX JVMs
Initial incomplete implementation of file transfer.