Force three-argument lambdas/procs

Change code and tests to always use three-argument lambdas (record, accumulator, context). Having a single, consistent signature will make the creation of macros and other custom code less error-prone.