Condensed the code for validating context-like macros.

Since there were three almost identical versions of
`validate-*-syntax`, it makes made more sense to condense them all into
one method. After making this change, it seemed logical to put all of
the context-like macros into one file.