fixed equality test bug in NodeFactory

there was a `=== null' check which does not cover cases of undefined
variables --> changed to `== null'
moved method definition out of the Class.create method

The TypeMapper.getInstance method did not work properly if defined
inside the Class.create method. I thus defined getInstance explicitly on
the TypeMapper function.
fixed equality test bug in TypeMapper

there was a `=== null' check which does not cover cases of undefined
variables --> changed to `== null'
added some test cases for NodeFactory