Pull in dagre-d3 v0.4.0 / let dagre manage all rankDirs

I like what you've been doing with dagre-d3. I hope at some point we can pull some of it back - if that aligns with your goals. In the meantime, I've made some updates to dagre-d3 that simplifies some of your code. If you pull the latest from my repo, you'll also get some minor improvements to the demos: they now auto resize the SVG to fit the contents.