Refectoring GCode viewer so that it draws everything in order.