Second pass at using an API for spec references.
Merge pull request #223 from tobie/api-fix

Second pass at using an API for spec references.