added nearest query cache for both brute search and r-tree based search. removed cmp calls that wasted lot of time as seen in v0.6.3 profile. abstracted out rtree and normal colormap generators. resized images are now properly cached into image_cache. colormap is no more an ugly tuple based list. one would argue, why not a dictionary, but then it is required as we're finding out min euclidean dist and need to search the whole space. While using R-trees, its upto the user to have libspatialindex installed and setup, as of now. Got a 74s gain using these improvements in generating mosaics out of 1000+ thumbnails.
…tested out sandbox preparation, fixed indentation issues in core.py