put loading of charms into a helper function

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>