Rewrite legacy app handler's command-line to use D-Bus
The GApplication object's command-line method does not work when the
application is running on the system bus. The solution is to use D-Bus
calls to communicate with the primary instance instead.
If the executable is called with command-line arguments, instead of
starting a GApplication it calls the Register() and Deregister()
methods instead.
This commit also adds all the necessary changes so that the legacy app
handler can be D-Bus activated on the system bus and started with
systemd.