Pass in fakeRequire to avoid having to remove it from define signature
Make templating/generation generic. Only dir filtering is when-specific now