Refactoring, cleanup and updates in build system

- Added detection for C++11 inherited constructors to the build system.
- Fixes of problems detected with clang.
- Updated several examples.
- Work-in-progress, some parts won't compile.