House elects Pelosi speaker as diverse new Congress begins