Fix upgrade behaviour

Refactor the upgrade function in an attempt to fix the upgrade
behaviour.  Create a list of features to install and uninstall for the
given state and uninstall the features in reversed order.  Only when all
features have been uninstalled start installing again.

This should fix issues with errors cause be features being unavailable
when other features were uninstalled.

Also add artifact field to list_bundles,  and use symbols instead of
strings.