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

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.
Also add a human understandable view of the json in an error message.