Improve encapsulation

- Make the pimpl class an inner class
- Add constructor for inner class and move constructor for outer
Similar changes for TCPServer

- Move InternalData directly into object