Minor memory usage improvements

* Don't store internal definitions if we're not starting a REPL, since
  they won't be used for interactive editing
* Use a strict map instead
* Clear original pattern definitions since they are only used for
  termination/coverage checking