Legislation includes measures to safeguard US military aid to Israel and offer federal protection to states that pass laws divesting from groups that boycott Israel