fixed bosh/js encoding bug, but still a ugly hack
shitload minor changes. added nodejs bosh support