Type safe resolve

- Fix: Type.getInitClassFromSource should return valid class name
- Add null check before converting native object
- Convert JS null object into nullptr 
- Update types test cases