Track deployed state for charms and wait to add relations

Wait to add relations if services are not up yet.
Includes significant refactoring to reduce code duplication between multi and single cases.

Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>