rename BuildState to Codegen and separate file, add unary!