New version. Same code as v2, but comments improved to explain thereasoning, with reference to README's buffer access rules. I'mplanning to push this soon if there are no objections.