Flexible standalone middleware stacker with hooks