Faster implementation of readPacket. Improves API.
Updates doc comments.