Rebase differential_rotation branch

DO NOT MERGE THIS!


This is a very complex rebase of the `differential_rotation` branch, I have put it here so that @wafels can check that I haven't done anything bad with the code in the process.