Added new mehod for assigning a new format to an existing keycode.
Slightly improved test for formatting.