Completed polymino puzzle class hierarchy with mask utils.