modification in the way we get the displayed path

* refactor of _lp_shorten_path
* if bash is used and bash's version is 4 or greater we'll use the
PROMPT_DIRTRIM var which is a builtin way to shorten path

(redoing #71 which was quite messy and got mixed up with unrelated change)