cockpit: Fix problems with JSON generation and parsing

Fix various issues with JSON generation that are present in upstream
json-glib:

https://bugzilla.gnome.org/show_bug.cgi?id=727593
https://bugzilla.gnome.org/show_bug.cgi?id=728951

In addition clean up our JSON parsing and generation API so we don't
have to constantly carry around JsonGenerator and JsonParser objects.

Fixes #413

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
daemon: Remove workarounds for lousy JSON encoding

json-glib had a generator bug, and we do our own generation now.
So remove the hacks necessary to work around json-glib.

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
spawn.js is auto-generated and .dirstamp is used internally by automake.
Let's ignore both.
common: Clearer split between CockpitPipe and CockpitPipeTransport

After this commit CockpitPipeTransport owns a CockpitPipe. This
simplifies the spawning constructors, and moves the cockpit-ws
logic into that code, rather than leaking it into common code.

In addition the "name" property of CockpitTransport, doesn't need
to be writable. Each of the transports now derive their logging name
from another property.

Closes #503

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ws: Use global tunables for setting testing/debug/mock options

Instead of cluttering up function signatures, use global tunables
to set tunables used during testing or in debug mode.

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
cockpit: Add cockpit_json_parse_object() method

And make cockpit_json_parse_bytes() return a JsonObject. It's by far
the most common situation that we're parsing and writing JsonObject
rather than individual JsonNode. So make those cases realy easy.

Related to #413
Closes #508

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
- Removed a merge conflict header
- Added an = NULL in cockptidbusjson.c
daemon: Remove unused function in cgroup code

This seemed to start causing problems with Travis CI.

Closes #511
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Put cockpit-main into $cockpit scope.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Move initial login attempt to login.js.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Remove obsolete jqmismin from cockpit-dashboard.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Make DBusClient useable also when it's not ready.

By adding DBusClient.prototype.get and emitting change notification
signals during the initial seeding.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Add plot.destroy method.

To completely clean up before replacing a plot with another.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Allow creation of plots on non-ready resource monitors.

The plot will wait until the needed properties of the resource monitor
have useful values.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Support for reusing D-Bus clients.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Tell pages when they appear in the breadcrumb.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Remove cockpit_dbus_client.

Instead, each page gets the clients it wants.  The pages have been
fixed to survive with a client that is not yet ready, but they might
not do that in the prettiest way possible.

When the connection is lost spontaneously, the UI does nothing special
now.  It mostly freezes and button clicks result in immediate errors.
This will be improved in a later commit.

Reviewed-by: Stef Walter <stefw@redhat.com>
tests: Remove a race in initial setup.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Remove app-lifecycle funcs from $cockpit API.

They don't belong there.

Reviewed-by: Stef Walter <stefw@redhat.com>
Remove stray com.redhat.Cockpit.conf file

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Remove unused .gitmodules file

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