Fixed parse_filename.
Fixed inferring the base name.
Add tests for parse_filename.
Test full path on windows and unix.
Merge pull request #6265 from cel4/fix_parse_filename

parse_filename: Fixed issues when file name contains dots.