Update Hook with a sleep fix and support the broadcast plugin in Openfire

This request is to update the hook so that it will be able to support the Openfire [1] broadcast plugin [2] in the case of the user not wanting to use a MUC for this.

There is also a small amount of input filtering added to the `php://input` to check that we at least received some valid JSON.

[1] http://www.igniterealtime.org/projects/openfire/
[2] http://www.igniterealtime.org/projects/openfire/plugins/broadcast/readme.html