Fixed issue with regex not properly handling dot in file names without e...

...xtensions

Here is a link to test the regex http://regex101.com/r/iI6oQ0/2
This method only removes the last extension, while I still think we should remove _all_ the extensions.
A regex like 
``` JS
fileName.replace(/\..+$/, "");
```
could do that.