[Filesystem] Fix and complete the API

Implement the spec.
Fix and pass the TCT tests.
Fix and complete the example.

BUG=XWALK-1071
BUG=XWALK-1827
suggest as to avoid unnecessary string construction when `to` is empty.  

```
if(to.empty())
  return "";

std::string explicit_to = to;
```