Support loading/saving bytecode from/to memory buffers
Removed unnessesary malloc