Better CMake organization and unit test cleanups

* created a static library containing most source modules
  to avoid compiling source modules twice in code and unit tests
* moved profile_test to main unit tests executable
* removed image_test and edit_test as not really useful