function getFn(fn) {
    var inMultibrowserMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    if (typeof fn === 'function' || inMultibrowserMode && fn.indexOf('function (') === 0) {
        // Handle function script
        return fn.toString();
    }

    return `function(){${fn}}`;
}
Transforms function into string if necessaty
@param  {Function} fn                         function to execute on client side
@param  {Boolean}  [inMultibrowserMode=false] flag that is true if using multibrowser (multiremote)
@return {String}                              stringified function