* convert file ext to lowercase for format detection
To ensure proper file format detection with case-insensitive file
systems.
* use filepath.Ext for more reliable file ext detection
especially for paths like index.js/foo
* add a test for file ext based format detection