Added "debug_log" command handling, it puts the parameter to console.log() on client.
Added "ping", "ping_request", "ping_response" commands, B.ping() and also debug logging of the values calculated.
Added _clamp() helper, added _clamp() to gfx_render_shots().
Replaced Math calls with standard operators in _clamp() to shorten and speed it up.
Made canvas to reset properly.
Added two try-catch blocks in render_frame() to prevent frame_number and tick_number skews caused by exceptions.