cleanup wml unit tests code

replace a complicated type with a typedef,
add some comments