Generalize template variables in Forkmodule class

Fixes #31