bonescript.js: add handlers for connection status