refactor writing files, replaced with stream API
test .mk generation, fix immediately function invokation when requiring modules