Directory path code cleanup
Merge branch 'CRM-15365' into 4.5