CRM-15365 - Windows Directory Fixes

CRM-15365 - Fix problems with adjusting directories through the UI
CRM-15365 - Prevent adding a double trailing slash
Merge pull request #4245 from colemanw/CRM-15365

CRM-15365 - Windows directory fixes