More refactoring. All ByteBuf leaks are fixed. Engine is in 'ready to run' state.