See if sort operators work with aggregates with an internal state type

Revert "Revert "Add inverse transition functions for the bool_and and bool_or aggregates.""

This reverts commit 46aca71384815eb9edc617946d54681515f5491f.
Add sort operators for aggregates bool_and, bool_or and every