Integration up to the top

Nick's changes are contained within amongst my own.