Better number handling throughout
Reintroduce write_cb

libtsm gracefully handles a missing callback by doing nothing at all.
Don't crash on EOF