Move adapter_info(Sock) to the Erlang client.
Various tweaks.
API change
Move API (sort of, I didn't want to dump a load of code here).
Make input and output clearer.
merge bug25391 into default