Tune performance of palette file searches

With these changes I can use the palette file search on the chromium source code. I also fixed what I think is a bug in the debouncing.