tools: factor Cuboid into tools.util package