Move general-purpose classes into util and problem sub-packages