code: function promiseForCallback( fun, callback) {
          var deferred = Q.defer();
          fun( function( error, result) {
              callback(error, result, deferred);
          });
          return deferred.promise;
      }
docs: Returns a promise handling the function and taking a callback to state what to do with the deferred object
  @param fun - the function to be executed
  @param callback - the callback with signature function ( err, result, deferred)
  @returns {*|promise} - the promise generated