Start rewrite to use a single pty.

Currently not working - not sure why.
Some more work. Still not working (why?)!
Now working mostly. Still no job control.

This may be a pain to solve - stuff to do with being a session leader
and all that seems to come up with depressing regularity.
Add internal event type.
Add data collection agents.
Prompt agent will need to be passed particular arguments.
Set up daemon, various other things.
Add some documentation on what precisely the agents do.
Clean up network socket on exit.
Set up both the prompt command and debug trap agents.
Ignore scratch files.
Capture standard input.
Work on the daemon. PROMPT_COMMAND now working.

Note that sinking to files is a temporary measure, because once all
the data is being recorded correctly we need to sessionise it.

Trap command is still not working, need to explore why. One annoying
thing is that it fires on the prompt command events, which needs to
be sorted.
Fix trap command.

Was using the wrong variable - it's $PPID, not $BASHPPID. Of course.
Build infrastructure for merging streams.

Need to write a sessioniser, then this should hopefully work.
Hlint removing.
Compiling with sessionization.

Not working at the moment - needs debugging.
Add Show and Eq instances for records.
Get stdout working. Not sure what changed :-(
Rewrite some of the resource transformer stuff.

Still not getting debug/trap events after the first. Guessing it's a
problem with the socket listener, now.