Fix reloading controllers when to_prepare blocks are used in the app

Call prepare to run to_prepare blocks after marking all for reloading.