Refactoring of BindLink validation/syntax-checking code.

This patches separates the code that does syntax checking of the BindLink from the code that performs the actual pattern matching.

As a side utility, there is now a scheme function "cog-validate-bindlink" that will perform the syntax checking only, and nothing else. 

All this is in partial support for bug #1159