Added tests for ToTypeFunc (#19). Improved HasIdFunc.

All 605u tests pass.