fix #18 by allowing hashes to be nested

This is the same problem we had to solve in Base so I've reused that
code to handle this case as well.