Optimal implementation of to_chars. Added test to methods in charitems.py