Add schemas code, second attempt.

Don't use isDefined to project an unsafe method. Instead for map use `.get` which will give you an option and then work  with that. This could be:
```scala
val x = for {
  pc <- hist.counts.get(parent)
  cc <- hist.counts.get(child)
  if pc == cc
} yield parent

x.toSet
```