Changed order of plugin setup block and setup_middleware

In 17176f15aa (v5.90052) the plugin setup block was moved up to be called immediately after setup_plugins(), however, this causes issues with initialization order of other plugins that hook into setup(). This commit moves the block back down to where it used to be. This also required setup_middleware to be moved down as well, immediately after the plugin setup block and before setup_components.