CMake work.

Added proper config file generation.  Simplified library target property
setting.  Added IDE folders for library, test and example targets.

Fixes #328.