cleanups related to fix for #63

 - pulled resource cleanup stuff for java input/output streams to its own file