Restructured createdb script with metadata extraction included.