Release 4.0.0

Pulling latest changes from jim into mine.