Order tunnels by layer

This makes sure that the group-by on layer for tunnels works correctly,
and that tunnels are correctly stacked per layer.
Merge pull request #559 from math1985/tunnels-order-2

Order tunnels by layer