Improve python Lib

Change const TYPE & to TYPE const& in valtypes and ptrtypes
Use SWIG_Traits_frag in traits_ptypen in order to avoid duplicate code if we use %traits_swigtype somewhere