Which economic associations gained power in the towns?