Strip out leading/trailing slashes.