agent: Add cockpit_channel_get_generator() function

Returns a cached generator from the channel, which can be shared by
both implementations and the channel itself for efficiency.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Add the cockpit_channel_close_option() function

This adds an string option to the close message for the channel.
It must be called before the channel close message is sent.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Add the cockpit_channel_close_int_option() function

This adds an integer option to the close message for the channel.
It must be called before the channel close message is sent.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Expose channel close options in Channel.on("close")

Instead of having a reason argument to the event, there's now the
full options, so handlers can access any field of the close message.
This is symettrical with the Channel(@options) constructor.

In addition accept @options instead of a @reason in Channel.close()

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Send exit-status and exit-signal in text-stream

If a text-stream is a spawn type text-stream then send the
exit-status and/or exit-signal in the close options.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Implement $cockpit.spawn() method

This creates a deferred jQuery object on which you can listen for
output from a process, send data to the proces, etc...

Internally uses the text-stream channel with a "spawn" open
option.

Documentation in spawn.js

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Remove Manager.Run() dbus method

Use the $cockpit.spawn() channel instead to run commands.

Closes #474
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>