Allow the message collection to be executed in a user-defined context

This allows a user to execute message collection within a custom context.