JS bind function, using the native Function.prototype.bind when possible