Improve error reporting and handling. command.c gets the new function print_error(), which sends a GError to the client.
Reduce header dependencies.