put rewrite

Better compatibility with cross string output
Use correct put calling convention (free function)
Improve format tests
Improve put implementation and semantics