(function(module){
  var _ = require("underscore");

  function Squasher(input, prepend) {
    this.input = input;
    this.prepend = prepend || '';
  }

  var fn = Squasher.prototype;

  fn.squash = function() {
    if (this.output) {
      return this.output;
    } else {
      return this.output = this.buildOutput();
    }
  };

  fn.buildOutput = function() {
    var output = {};

    for (key in this.input) {
      var value = this.input[key],
          newKey = this.buildKey(key),
          append;

      if (value.constructor == {}.constructor) {
        append = new Squasher(value, newKey).squash();
      } else {
        append = {};
        append[newKey] = value
      };

      _.extend(output, append);
    }

    return output;
  };

  fn.buildKey = function(key) {
    return (this.prepend + '_' + key).replace(/^_/, '')
  };

  module.exports = {
    squash: function(json) {
      return new Squasher(json).squash();
    }
  };
})(module);


@@ -501,21 +501,193 @@
   append
+ = this.squashValue(newKey, value);%0A      _.extend(output, append);%0A    %7D%0A%0A    return output;%0A  %7D;%0A%0A  fn.squashValue = function(key, value) %7B%0A    var append = %7B%7D, that = this
 ;%0A%0A
-  
     if (
@@ -723,34 +723,32 @@
 ructor) %7B%0A      
-  
 append = new Squ
@@ -760,20 +760,17 @@
 (value, 
-newK
+k
 ey).squa
@@ -779,18 +779,16 @@
 ();%0A    
- 
- 
 %7D else %7B
@@ -792,31 +792,8 @@
 e %7B%0A
-        append = %7B%7D;%0A  
     
@@ -801,20 +801,17 @@
  append%5B
-newK
+k
 ey%5D = va
@@ -822,18 +822,16 @@
     
-  
 %7D;%0A%0A    
   _.
@@ -830,60 +830,21 @@
     
-  _.extend(output, append);%0A    %7D%0A%0A    return output
+return append
 ;%0A  
@@ -987,24 +987,50 @@
 ion(json) %7B%0A
+      console.info(json);%0A
       return

Handle arrays