function getFunctionName(func) {
  var ret = func.toString();
  ret = ret.substr('function '.length);
  ret = ret.substr(0, ret.indexOf('('));
  return ret;
}
Utility function for getting a function name.
@function
@param {function} func - The function to get the name
@returns {string} Name of function.