A Novel Framework for Relating Quasi-Cyclic Codes and Quasi-Twisted Codes