Fix the use of `pcall`.
Replace `push` -> `insert`.
Fix uses of `Cursor` in net.lua.
Clean up `bytes_to_int` like `int_to_bytes`.
Fix `ipairs` in `to_json`.