Next Protocol Negotiation redux

This is the same as #86, but with all the changes that @exarkun requested in place.

Tests pass for me locally, let's hope Travis is happy.