remove last trailing slash if exists

original php function works with path with trailing slash at the end too.
Update basename.js

test fix.
tabs.
Merge pull request #128 from yadimon/patch-1

remove last trailing slash if exists