A simple Barrier library for javascript.