Add static generator

Close #163
I wonder if there would be some opportunity for code reuse here...