Initial work migrate to allowing different transformers other than plain
websockets to support other frameworks such as primus.
Tidy code.