Fix [string replace] replacing single char

Also added some additional tests

Signed-off-by: Steve Bennett <steveb@workware.net.au>