Added send / receive failure limit support.
Added improvements to error handling.
Added disconnect support and auto-disconnect upon page unloading.
Added receive id checking on messages to validate proper order.