Group devices according to their bus in legacy module.

Now that we have the *bus* property in the Device class, we can group
devices according to their bus, just like 0.4 version.