Fix metadata lookup in rets script

Fix namespace when looking for METADATA_TYPES
Add metadata_types to metadata lookup
Add -l (resolve/lookup) option