Tried the state-polling approach in 32cd62e. Seems pretty okay to me. Any objections?