This is the bulk of the fixes to the test suite to get it working with the current version of AMP.  The test coverage is not huge, but is better then nothing.