First pass at caching palette results, reference search.

See also #57.