Fixed synchronization for everything except readLine()
Support for receiving messages added.