Add a unittest for the interpreter.
Free python objects in the interpreter when possible.

The goal is to reduce the memory consumption.