Legend: move placing of groups and traces together
Legend: move placing of groups and traces together

* Moved the placing of legend groups to `computeLegendDimensions` so
  that they are handled along with the placing of legend traces.

* This change is a preliminary step to implement horizontal legends.

* Checked all jasmine and image tests still pass.

etpinard/plotly.js,aburato/plotly.js,etpinard/plotly.js,plotly/plotly.js,plotly/plotly.js,aburato/plotly.js,asolagmbh/plotly.js,etpinard/plotly.js,iongroup/plotly.js,plotly/plotly.js,asolagmbh/plotly.js,iongroup/plotly.js,asolagmbh/plotly.js,iongroup/plotly.js,plotly/plotly.js