/*
function promisify(fn, ...args) {
return new Promise((resolve, reject) => {
args = args.slice();
args.push(function(err, result) {
if (err)
reject(err);
else
resolve(result);
});
try {
fn.apply(null, args);
} catch(ex) {
reject(ex);
}
});
}
module.exports.promisify = promisify;
function promisifyThis(fn, self, ...args) {
  return new Promise((resolve, reject) => {
    args = args.slice();
    args.push(function(err, result) {
      if (err) {
        reject(err); 
      } else {
        resolve(result); 
      }
    });
    try {
      fn.apply(self, args);
    } catch (ex) {
      reject(ex);
    }
  });
}