IO: Added DFS metadata handler

> Extract of DFS from #1017
Why are you using `RuntimeException` if you prefer `BadStateException`? :wink: