Added on reply/request/connect functions. Fixed default resource arg in init

* Also added some support for functionality recently added to bosh/tcp e.g. not crashing on bad parse