Copy of underscore.js debounce method