More string functions into separate module

... and add a couple of tests.
Code cleanup

* serialization of sint* fixed