Strip trailing slash eventually and add unit tests.