Added basic encoding of have, request, cancel, piece and port msgs.