Sanitize cxx type handling

* Remove obsolete/unused code
* Use a generic type builder for all types
* Cleaner class hierarchy
* Add doctest / docstring accordingly