[WIP] insert variable disposal instructions in the IR

This should help fix #578
I would prefer to use a private instance of Random() with a specific seed (initialized in the setUp() method) in unit tests.  That way we are guaranteed deterministic execution regardless of test order.