generalize function application from id to expression
split type check tests into two groups, test function applications
add -d debug option
some more function application tests