(maint) Remove unused/inefficient code

The optional_parameter_count method isn't used anymore, the signature
calculates that as it figures out the signatures. There were also a few
places that used slightly inefficent means of doing things. Using a proc
reference instead of a block is much faster. It also removes some
garbage creation that isn't needed during the type signature
calculation.
(PUP-514) Type check EPP arguments

This adds type checking to the call_by_name invocation of closures,
which is used for EPP templates. There is a pending test for issuing an
error for slurp parameters in EPP templates.