Using $PWD directly for dirhistory

We can use the $PWD variable instead of executing pwd. This means we do not have to open an extra process on every directory change.