[WIP] add extra string handling functions

This is WIP, I'm just putting this in a PR so other people can look and give suggestions.

ref: #859
`xstrlcpy` always  `NUL` terminates if `bufsize > 0`.