New research shows that the properties of mugs, legs and liquid conspire to cause spills. We have tips.