More regular @rewrite/@intern handling.

Use the normal stack also for @rewrite and @intern rule and pull
them from stack in the @eq rule.
Small bug fixes
Better CC-Lemma handling