Improved simulation of stabilizer circuits

Improved simulation of stabilizer circuits