Don't cache alt trans and limit emit calls

Now we cache empty results to avoid repeated (useless) queries. We
also stop caching alt trans results, which depend on more than just
the source text (this is unique per unit).
Only evict units affected by a change in translation

Only certain units in the cache can possibly be affected by a new
translation, so we don't need to obliterate the whole cache.
Cosmetic
Factor out common code