Rewrite search_tuples construction for simpler code in search (core.py).
Simplify search_tuples generation in search (core.py).
Remove unneeded empty list construction in search (core.py).
Small performance experiments in search (core.py).