BMP isn't so trivial, largely because it's been extended multiple times while never having a proper spec.
http://searchfox.org/mozilla-central/rev/bbc1c59e460a27b2092... has some of the gory details.
http://searchfox.org/mozilla-central/rev/bbc1c59e460a27b2092... has some of the gory details.