add debug functions that log to to a file
add sircc_utf8_sequence_length()
fix overflow when a history entry ends with a format sequence