Added on reply/request/connect functions. 

* Also fixed some defaults arguments.
* Also added some support for functionality recently added to bosh/tcp e.g. not crashing on bad parse and "timeouts" Needs more work though