web: Factor out the DBusClient and DockerClient object caches.

We will use this pattern also for the upcoming NetworkManager code.

Close #628

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