Implement logging for new string type

Work in progress, code should be compiling.
Tried to generate less code, using more library functions.