Intermediate changes to database contract generator.
Split generator into schema portion and helper macro portion.