anchor.diff:          return new Future.value("");
         }
   
  +      // Delete temporary directory
  +      modelDir.deleteSync(recursive: true);
  +
         // Parse out code from stdout
         List<String> contentWithJson = content.split('\n');
   
  -      for(var i = 0; i < contentWithJson.length; i++) {
  -        // Order of checks based on probability of hits in content
  -        if(contentWithJson[i].contains("extends") &&
  -           contentWithJson[i].contains("VaneModel") &&
  -           contentWithJson[i].contains("class")) {
  -          String clazz = contentWithJson[i].split('extends')[0].trim().split(' ')[1];
  +      // Loop over generated code and add it to the model classes
  +      List<String> generatedCode = codeGen.stdout.toString().split(delimit);
  +      for(var i = 0; i < generatedCode.length; i++) {
  +        // Save generated code (and inherently it's length used below)
  +        models[i].code = generatedCode[i].split('\n');
   
  -          while(i < contentWithJson.length) {
  -            i++;
  +        // Calculate offset used to insert generated code, we add the original
  +        // row the class was found at with the totalt amount of inserted row
  +        // so far (the added rows from added generated code).
  +        int offset = models.sublist(0, i).fold(0, (x, y) => x + y.code.length);
   
  -            if(contentWithJson[i].contains('${clazz}.model()') == true) {
  -              contentWithJson.insert(i + 1, '\n${codeGen.stdout}');
  -              i = i + 1 + codeGen.stdout.length;
  -              break;
  -            }
  -          }
  -        }
  +        // Add the original row to the offset
  +        offset = offset + models[i].row;
  +
  +        // Add function used for Json encode/decode to the outputed code
  +        contentWithJson.insertAll(offset, models[i].code);
         }
   
         // Write new code with json serialization code to build dir
  
positive.code:           => l.contains("import 'package:")).forEach((line) {
          // Parse out the package name from the import string
          String pkgName = line.substring(16, line.length).split('/')[0];
  
          // Add dependency to pubspec.yaml
          if(pkgName == "vane") {
  
negative.code:     transform.primaryInput.readAsString().then((String content) {
        var id = transform.primaryInput.id;
        List<String> lines = content.split('\n');
        List<Model> models = new List<Model>();
  
        bool lookForConstructor = false;
  
        // Only run transformer on Dart files that contain VaneModel classes
        for(var i = 0; i < lines.length; i++) {
          // Order of checks based on probability of hits in content
          if(lines[i].contains("VaneModel") &&
             lines[i].contains("extends") &&
             lines[i].contains("class")) {
            String model = lines[i].split('extends')[0].trim().split(' ')[1];
  
            // Save model
            models.add(new Model(model, "", i + 1));
  
            // Start looking for a model constructor
            lookForConstructor = true;
          }
  
          // If we have found a model, we continue to look to see what constructor
          // that model need. We have three alternatives, an empty constructor
          // like "Foo();", or an empty model constructor like "Foo.model();" or
          // if we don't find any constructor we assume it's an empty constructor.
          if(lookForConstructor == true) {
            if(lines[i].contains("${models.last.name}.model();")) {
              models.last.constructor = ".model";
              lookForConstructor = false;
            }
          }
        }
  
        if(models.isEmpty) {
          c.complete(true);
          return new Future.value("");
        } else {
          transform.logger.info('Generating code for VaneModel classes: ${models.sublist(1).fold('${models[0].name}', (x, y) => "$x, ${y.name}")}');
        }
  
        // Create a copy of the code that we can use as a base for our generated
        // code that we later execute to produce the json serialization code.
        String codeGenerationCode = new String.fromCharCodes(content.codeUnits);
        String delimit = "1592fec14205f706c94019a3bb82df25a6e9754f22ab845d102a137e3cbdfb08";
  
        // Add start of code generation code
        codeGenerationCode = '${codeGenerationCode}\nvoid main() {  print("");';
        final k = models.length - 1;
  
        // Add code for each declared model
        for(var i = 0; i < models.length; i++) {
          codeGenerationCode = '${codeGenerationCode}\n  print(VaneModel.transform(new ${models[i].name}${models[i].constructor}()));';
          if(i < k) {
            codeGenerationCode = '${codeGenerationCode}\n  print("${delimit}");';
          }
        }
  
        // Add end of code generation code
        codeGenerationCode = '${codeGenerationCode}\n}\n\n';
  
        // Create a temp directory
        Directory modelDir = Directory.systemTemp.createTempSync('vane_model_');
  