Properly serialize bdm: fixes OS-230.

Our call to select_hosts (we are the only consumer!) was passing the raw bdm
object harvested from the db. Qpid can't really serialize this and was
croaking, rightly so.

Refactor our conversion of the bdm into dict(s), and reuse appropriately.

Unit tests expanded.

Change-Id: I33366c13f6e24fc2abb2968e1292fae0833cceb0