The photon energy spectrum in $B\to X_s\gamma$ at N$^3$LL$'$