bug fixes. begin support for > 65535 byte payloads. clean-up