The eventual solution may be quite different to the title of this bug - but we can use this as a tracking bug anyway.