4.0.1

Contains changes for 4.0.1 plus a start to the integration tests