Moving-Horizon State Estimation for Power Networks and Synchronous Generators