Standardize the internal interface for receiving messages

This has been bugging me for a while, and it looks like at least stmt.Close still has a bug in it as a result of the difficult-to-use interface.

Any thoughts?