converted input spec to signature/label pairs in preparation for label based references in source code

refactored out signature checking into its own function