Used hooks to capture $stdout/$stderr during eval

This allows one to capture output only when code is being
evaluated. It also prevents a client from stealing messages from another
one if there are multiple ones.
Merge remote-tracking branch 'origin/fix/multiple-connections'