Add FileHelpers.ResolveRelativePath and use it.

Instead of copy pasting this code around, just have one implementation.

Fixes #2577