Refactored java code.  Now bins can be reloaded from buffers (in theory)