Implement the new BDM mapping

Start with a few tests too

Change-Id: Ib59ccd9f48c458d1249b94cefebd03d465359246