Properly handling relative paths for require(...) with './' or '../'