Use complex numbers to store the freq/avgidx pair in search (core.py).
Performance experiments in search (core.py).
Further performance experiments in search (core.py).