Dynamic consensus eqc

Add a working eqc test and fix any bugs found.