Add more tests and a first version of socket listener