Handle various environments better, including the REPL. More test options.