update some comments; do not use variables on prototype
add test cases for waitRule and dialog