Added an option to allow attachSchema to replace any existing schema, rather than being combined with it.