clean up initialization of the teachpacks in an empty repl

In more detail, the way the initial namespace was being set up was
different than the way that you get if you just hit 'Run' on an
empty program. So change the initial namespace creation to more closely
mimic the way an running an empty program works.
fix timeout computation in the REPL io

In the case that the flush queue was empty, the first byte that
comes it would appear to have come from a long time ago and
thus get flushed immediately.

Instead, when the first byte comes in, we restart the timer at that
point, intead of holding the old value
do a better job of keeping the err/out ports IO in the right order

... in the case that IO happens during the 'first-opened' method,
e.g., during teachpack running in an empty REPL