Added dbref2sdb() and sdb2friendly()

Accidently left these out in a previous commit. Thanks for Demac for reporting it.