Update to 4.0

A wide variety of updates.