add output stream varint write utils and tests