Fix order of imports

This has an impact on SWIG_TypeQuery.
If a type is used before it is defined, SWIG_TypeQuery("OT::foo *")
returns 0 and SWIG_ConvertPtr will accept to cast any pointer into
this type.

Currently OT::Domain, OT::DrawableImplementation and
OT::NumericalMathFunctionImplementation are affected.
Replace SWIG_TypeQuery() calls by SWIGTYPE_* macro when handling OT objects

See previous commit why SWIG_TypeQuery() sometimes does not work as expected.