Add support for nested specifications

Simpler than I imagined. Hope it helps.