Track deployed state for charms and wait to add relations if services are not up yet. Includes significant refactoring to reduce code duplication.

Signed-off-by: Michael McCracken <mike.mccracken@canonical.com>
Merge pull request #10 from mikemccracken/add-charm-state

Track deployed state for charms and wait to add relations