Very basic merging works, though not by user interaction.

Also fixed a bug where divAngle was calculated incorrectly.