Add cyclicbarrier implementation, lots of unit tests