Initial Work on W3C Test Compliance

Sorry for the huge pull request, but I have been working through a number of changes and refactorings to get better support for a number of the W3C tests.  I thought that these changes would prove useful in the main branch.  Part of the huge commit is including many of the W3C tests in the code so that other developers can work through them as well.