[After 2.0 GA] Fix issues in type merging (Initial refactorings to Cypher type system)

For merge before 2.0.0-RC2