refactoring: remotepath_split / remotepath_join, simplify glob