fix singleton in test 11 and major simplification of codebase in CodeGenerator (most stuff was just duplicated)