title: undefined is not a function after refactor
body: <p>I put my code into different modules:</p>
  
  <pre><code>.....
  var util = require('util');
  var s3 = new AWS.S3();
  
  exports.perform_flatten = function(event, context) {
       .......
       CONTEXT = context;
  
     s3_helper.get_object(SRC_BUCKET, SRC_KEY, this.flatten);
  };
  </code></pre>
  
  <p>this.flatten is a callback to a module in the same file</p>
  
  <pre><code>exports.flatten = function(data){
      .......
  
   s3.putObject({Bucket: dst_bucket, Key: dst_key, Body: buffer}, function(err, data) {
      if (err){
        console.log(err, err.stack); // an error occurred
      }else{
        console.log(data);           // successful response
        CONTEXT.done();
      }
    });
  }
  </code></pre>
  
  <p>The <b>code runs perfectly until</b> it comes to this line <code>CONTEXT.done();</code>.</p>
  
  <p>Then I get the error: <code>undefined is not a function</code></p>
  
  <p><b>I do not understand why? Especially because I believe I declared CONTEXT as global right?</b></p>
  
  <p>I have to call <code>context.done()</code> in order to execute a Lambda function on Amazon. <a href="http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html" rel="nofollow">http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html</a> THANKS</p>