add support for better error messages

This includes extended error messages which show the original format
string. It works for 'char' type with wchar_t returning only the
message.

The thrown exception class now has a format() method to retrieve the
pointer to the original format.