allow saveobj to save bitcode and llvmir.
Support saving all objects execept executables directly to memory.