BTW, the error is testmodule.d(14): Error: undefined identifier main which suggests that the template can't find the module. I can import the module and it will work fine but this seems a bit circular. I will try and mixin the module to solve my original problem but still need to figure out how to handle overloads.