migratebundle: relation inference

The testing is a little on the light side, but has been manually verified against all known bundles
that we need to migrate.

An example of input -> output transformation would really help here.