Fixed memory management in String class

Checking if d points to sharedNull more frequently now.
Hopefully corrected bugs in String append now.