CMake improvements

This uses the new COMPONENTS syntax for Qt5, corrects the pkgconfig logic and adds support for the generation of Config files. It can definitely be improved, it was a quick hack to make the library build and work for us, including its detection.