Updated consensus library to deal with race conditions, created average number tests