Unit tests for Xmf, also some fixes for issues found along the way
Convert to UTF-8 (was ISO 8859-1)
Use standard PHP filter_var for checkEmail

Standard FILTER_VALIDATE_EMAIL now handles email quite well, including edge cases that current routines didn't.

Also added some extended cases in unit test.