Add schemas code, second attempt.

FYI, nested objects/classes take up more space and have a higher potential to cause serialisation issues with scalding since they also need to keep a reference to the outer class.