use platform-specific path separators

Windows uses "\" as a path separator. This normalizes things so we can
use "/" in the require() call and not break the absolute path returned
from context. The third replace() call in Unix is a no-op.