[doc] add a TODO.md
[fix] handle case where OLDPWD doesn't exists
[mod] small refactoring