Move widget code to its own file for tidiness
Separate the session's transcript from its environment

Formerly the history was treated as the environment; however, we want
to distinguish between the global state of the interpreter, and the
inputs and outputs. The history ($* variables) are now dealt with as a
mechanism of the session, outside the interpreter.

NB the (de)serialisastion of global values is still a little crude,
and only deals with primitive values so far (i.e., not lazies and not
function values).