Iterative implementation of searchTimer

As suggested by @stefanpenner "recursive calls typically screw up the
runtimes optimizations".

Also a minor update about comparison with `undefined`.