modified throttle/debounce plugin to work with requirejs