Denormalize entity ids in Mongo.

When adding charms or bundles, store their URL parts
in separate fields.
Also implement a simple migration strategy.
I wonder if this should be inside the loop, so if two units are doing this at the
same time, they don't necessarily both do all the migrations. I guess that's
more of an issue if we have migrations that are mutually exclusive though,
and that's another bag of worms.