factorial is working

implemented assignment in a pattern
add factorial to test suite

also fix other test programs that use typevars