major rewrite to move all IO dependent code in java out of the core package so it can be separately tested