Added proper comments and more diagonal API

Tidied up classes to better reflect d3js' API and added up proper
documentation linking. TreeDemo also now more properly references the
API.