Fixes #795.
This reuses as much str implementation as possible, from this we can make them more separate as needed.