A wideband chemical survey of massive star-forming regions at subarcsecond resolution with the Submillimeter Array