Added new safeEncode method to BigTree -- should better handle HTML entities.