Add TCP server, some cross-platform stuff, misc work
Rework options parsing, fix some TCP bugs