Io layer refactor 2

This is a respin of a previous pull request:

See Apache JIRA: PROTON-749 [https://issues.apache.org/jira/browse/PROTON-749].

This code passed all the proton tests on Linux (Fedora 19], and all the tests I can run on Windows, which significantly only excludes the Java tests there.

For more details see the individual checkin comments,