Add support for :apply-middleware-fn in compile-dispatch-table