Add middleware proposal. HT @micha for middleware idea and @sbecker for research help.