Added a 'discover' command, writes a service definition file.

Basic detection of currently running services provides the list of
components. This can be made much more sophisticated but demonstrates
the point adequately.