Javascript Locks for Reliable and Predictable Tasking