Refactor node to string convertion in printing dot format
Refactor node to string convertion in printing dot format

Summary:
Code for node serialization in dot output is repeated.
We refactor the code for serialization into methods.

Test Plan: run DotTest.java and all passes

Reviewed By: sbalabanov

fbshipit-source-id: ed76c56

nguyentruongtho/buck,JoelMarcey/buck,LegNeato/buck,brettwooldridge/buck,zpao/buck,romanoid/buck,romanoid/buck,shs96c/buck,LegNeato/buck,JoelMarcey/buck,clonetwin26/buck,romanoid/buck,LegNeato/buck,zpao/buck,facebook/buck,romanoid/buck,ilya-klyuchnikov/buck,brettwooldridge/buck,rmaz/buck,facebook/buck,brettwooldridge/buck,Addepar/buck,JoelMarcey/buck,rmaz/buck,kageiit/buck,SeleniumHQ/buck,facebook/buck,nguyentruongtho/buck,kageiit/buck,shs96c/buck,SeleniumHQ/buck,SeleniumHQ/buck,brettwooldridge/buck,Addepar/buck,clonetwin26/buck,Addepar/buck,clonetwin26/buck,facebook/buck,romanoid/buck,ilya-klyuchnikov/buck,Addepar/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,Addepar/buck,kageiit/buck,JoelMarcey/buck,facebook/buck,JoelMarcey/buck,SeleniumHQ/buck,romanoid/buck,facebook/buck,kageiit/buck,ilya-klyuchnikov/buck,ilya-klyuchnikov/buck,Addepar/buck,zpao/buck,kageiit/buck,facebook/buck,romanoid/buck,romanoid/buck,JoelMarcey/buck,SeleniumHQ/buck,kageiit/buck,SeleniumHQ/buck,JoelMarcey/buck,Addepar/buck,clonetwin26/buck,ilya-klyuchnikov/buck,nguyentruongtho/buck,brettwooldridge/buck,LegNeato/buck,Addepar/buck,rmaz/buck,brettwooldridge/buck,LegNeato/buck,brettwooldridge/buck,nguyentruongtho/buck,shs96c/buck,rmaz/buck,clonetwin26/buck,ilya-klyuchnikov/buck,SeleniumHQ/buck,Addepar/buck,LegNeato/buck,SeleniumHQ/buck,LegNeato/buck,brettwooldridge/buck,rmaz/buck,clonetwin26/buck,clonetwin26/buck,SeleniumHQ/buck,kageiit/buck,Addepar/buck,ilya-klyuchnikov/buck,clonetwin26/buck,SeleniumHQ/buck,shs96c/buck,rmaz/buck,clonetwin26/buck,JoelMarcey/buck,shs96c/buck,rmaz/buck,zpao/buck,shs96c/buck,nguyentruongtho/buck,ilya-klyuchnikov/buck,rmaz/buck,JoelMarcey/buck,romanoid/buck,LegNeato/buck,Addepar/buck,JoelMarcey/buck,SeleniumHQ/buck,shs96c/buck,zpao/buck,brettwooldridge/buck,LegNeato/buck,shs96c/buck,rmaz/buck,ilya-klyuchnikov/buck,zpao/buck,romanoid/buck,clonetwin26/buck,rmaz/buck,romanoid/buck,shs96c/buck,romanoid/buck,LegNeato/buck,brettwooldridge/buck,JoelMarcey/buck,LegNeato/buck,romanoid/buck,zpao/buck,brettwooldridge/buck,JoelMarcey/buck,clonetwin26/buck,Addepar/buck,LegNeato/buck,clonetwin26/buck,SeleniumHQ/buck,brettwooldridge/buck,shs96c/buck,SeleniumHQ/buck,nguyentruongtho/buck,shs96c/buck,shs96c/buck,ilya-klyuchnikov/buck,nguyentruongtho/buck,brettwooldridge/buck,shs96c/buck,rmaz/buck,Addepar/buck,rmaz/buck,ilya-klyuchnikov/buck,LegNeato/buck,rmaz/buck,ilya-klyuchnikov/buck,clonetwin26/buck