Use more versatile extract-files.sh

Change-Id: Ieb9b51707a3a4621d501c9fe8d9f526e94302dc1