lib: generate: make the return values sane w/ errors
lib: generate: factor out model from file template
lib: generate: support biflows