Convert cumbersome conditionals into calls to goog.getObjectByName.