refactor to extract serialization, extensions and connections for use in other programs.
start working on simple http server