fixing nasty race conditions in bracket.js -- wip