Remove leading/trailing slashes/whitespace