Add is_unspecified/is_opaque test methods.

Having them will (probably) make the code to handle opqaue/unspecified
array/hash types a bit more uniform.