Add test project and start cleaning up the API leakage
More work to improve interface encapsulation
Add close method to socket
Further cleanups and tests