Change Iterator handling in REPL
More tests; only call shutdown once for a plugin