Refactor both libcfnet and cf-serverd in multiple files.