3x lookup speedup and a bunch of minor improvements

I've replaced qsort() with sort.h macros, which should give considerable results on large (16+) arrays of targets.
I also added simple checks to prevent repeated freeze() and realloc() calls, which resulted in 1.5x more speedup for lookups.
A very simple 'benchmark' calling chash_lookup() 100.000.000 times is now about 3 times faster:

# time ./chash_test 
real    0m31.027s
user    0m30.993s
sys     0m0.008s

# time ./chash_test 
real    0m9.789s
user    0m9.701s
sys     0m0.007s