Changed the way modules table is defined. Much easier now.