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.