Fold semantic checking over collections

Rather than using the fold to build a chain of semantic check functions.
This reduces the stack requirements for semantic checking.