Disable `latedef` JSHint option

Because it forces you to have helper functions atop of the main code,
which makes the code hard to read.
Tidy up

- move helper functions after the main code
- mv anyJSendFailure collectNonSuccessJSendResponses