debounce the handler if config is passed.

Currently, the handler gets called on every scroll event, which happens a lot and makes the browser chug. This adds a configurable debounce delay so that the handler won't be called until the user stops scrolling the page.