Move codegen tool under lib, generate relative imports

Yeah, we'll need to ability to import across packages.