improve dirname by returning an emtpy string when no directory path was present
get_extension return an empty string when no extension found
more precise name/ext extraction in get_extension