Added logic to pull in externally reference files in $ref.