Fixes #5982: In API/rules include/exclude is ordered for target parameter

The main idea here is that we are much more lenient about empty/missing part of the target, and in the same go we remove the mandatory ordering