Copied over all the networking files from an experimental codebase after I got lazy and stopped using git branches. Hopefully I'll be capable of keeping my different variants under proper control in the future.