Cleaned up tests and added some new tests. 4.0 Beta 1.