Added version number and split socket code into separate module