Add Generator class and support code

Generator is intended to be the preferred way to encapsulate Func building in user pipelines. This pull request probably could use more documentation, but the overall design and set of tests is solid enough to begin serious discussion.
Same comment about target. This is actually a case where I would really use the target, especially to turn off assertions in the generated Stmt.