Fix re-included module definitions and targets.

Also added tests for renaming targets (tests
CPM_ExportAdditionalLibraryTarget)