Issue #2796619 by colan: Added functions for formatting the variable hierarchy and sanitizing values.