Cache stored functions properly
JSON everything the way gorm does