Added file type detection.

Did file renames.