Add support for %b and %B.

Not completely working; DO NOT MERGE YET.