Feature/packages more unit tests

Missing unit tests for CCPackageManager along some bugfixes.