further simplifications of the codegen and the host API

review @densh