added initial code for WebSockets, improved test coverage and refactored other code to support WebSockets, such as DAOs