Implement toBuffer().  Add basic TCP option support.