[MONDRIAN-1735] merge of Julian's "unwrap" branch, plus some fixes to tests broken by the change.