More readable
Support for callback for close method
do tests properly and fix connection keep-alive issue which caused tests to fail