Refactor CodeGen, split genCallable into its own module