Move codegen tool under lib, generate relative imports