add typeOf for NTuples; make NTuple covariant

This pull request will enable defining functions taking NTuples.
I'd like to improve some of those pattern matching statements.