refactor type detection, now all implemented in OType , implemented type detection relative tests.