Implements LANG-1050: Change nullToEmpty methods to generics. Thanks to James Sawle. This closes #33 in GitHub too.