Correct spec structure
Add missing requires
Support conversion of #stub_chain

This closes #21.