Generalize and consolidate tildify
Generalize and consolidate tildify

- Don't do any substitution unless `home_dir_name` exists.

- Don't rely on `gsub` because it might interpret some characters in
  `home_dir` as magical (and might also replace a match not starting at
  the beginning of `path`).

koreader/koreader,mihailim/koreader,NickSavage/koreader,poire-z/koreader,Markismus/koreader,pazos/koreader,Frenzie/koreader,robert00s/koreader,koreader/koreader,mwoz123/koreader,NiLuJe/koreader,poire-z/koreader,Hzj-jie/koreader,Frenzie/koreader,houqp/koreader,apletnev/koreader,NiLuJe/koreader,lgeek/koreader