Bring tests up to date and add properties

NB this needs PropEr to be on the ERL_LIBS, at the minute.

En passant:

 - Throw an error instead of returning 'reserved' for reserved return
   codes. We shouldn't see them, so it's exceptional.
 - KeepAlive is a 16-bit unsigned, not a flag.