Refactor packet send/receive.
These are changes to make the class more generally useful:
* Change the recv() function to simply receive a single message.
* Add recv_all() which duplicates the previous functionality, where
  we loop and collect all pending packets.
* Add the send_query() function to send a query rather than send
  a query and receive answers.
* Change query() to use our new send_query() and recv_all()
  functions.
* Update the rest of the code to use these new functions properly.
Minor change so we return a tuple consistently from recv() function.
Handle case where timeout=0.
Works with Python 3
It is a bit kludgy in parts, explicitly checking for string type
(as opposed to array of bytes), but it works.
Merge pull request #19 from shane-kerr/master

Python 3 support, beginning of refactoring API