allow nil payload
cleaning up some tests and adding type hints
Merge pull request #15 from paulbellamy/nil-remaining-bytes

RFC: allow nil payload when encoding
Merge pull request #14 from paulbellamy/performance

cleaning up some tests and adding type hints