DJR:Working in both browser and node
DJR:Converted all boidies to FSMs