build: define filenameToIdentifier in terms of path.basename

See #647