Added trailing slash option

The generated URL is suffixed with a slash if configured in Magento backend.

Additionally, some whitespace was trimmed.