a few udpates for the mac

1. initialize mutex and localize use of trylock/unlock
2. fix callback arguments in simpletest.js
3. add basics.js as the skeleton for a simple streamer of system output
(it should go elsewhere, but i suspect we'll be testing with this for a
while)...