Add Xmf unit test

Add test scripts for Xmf along with various fixes for issues discovered during the process. Also fix a non-UTF-8 php file.

Also along for the ride is a patch to checkEmail to use standard PHP filter_var with FILTER_VALIDATE_EMAIL. This fixes a number of issues which have been creeping in with evolving domain name standard and gives us better conformance to current standards. Added a few more test cases to the unit tests.