devilry_detektor: Optimize and cache.

See #595.