Replace KSharedPtr with QExplicitlySharedDataPointer

REVIEW: 119108
Use CMake generate_export_header() instead of writing them manually

This exposes a few cyclic dependecies, compilation can be fixed by using
a custom target_include_directories() call

REVIEW: 119109
Use more generate_export_header

Somehow I missed these hand-written headers in the first patch