Refactor NERDTree opening mechanism in the new tab

This series commits provide a better way to open NERDTree window in a new tab, details provided in the commits message and comments.