Fix #4333 (files shown as plain text incorretly).

- Added FileUtils.getBaseName (jsdoc and unit tests included).
- Replace usage of path-utils.js with getBaseName.