Really add POJO support and nested keys for Scala API

This also adds more integration tests, but not all tests of the Java API
have been ported to Scala yet.