Extracted validate_xxx_options to a separate TargetValidator class which can be reused fro other parts of the code. Added spec for TargetValidator.