Make simpleBuilder general, remove boilerplate
Add tests for genTopLevelFunc*