move external type definitions to new cpp files

to avoid swig problems