dom/character_data: cleanup and add documentation