Added the register_format method, tests and supporting function.