Updated tern code using dart and websockets