moved more from C++ to js, introduced PING to detect shut down fotcom peers