Implemented DOM normalize method, added test.