Functorise over Activations, Xenstore and backing store

This allows much more of the high-level logic to be contained in the library rather than duplicated by apps.