cleanup map.js [DRY] (#1816)
cleanup map.js [DRY] (#1816)

* cleanup map.js [DRY]

- add change listener factory for switches
- remove duplicate switch initialization
- extract processing of response

* fix lured pokemon switch

creatingwake/PokemonGo-Map,creatingwake/PokemonGo-Map,creatingwake/PokemonGo-Map,creatingwake/PokemonGo-Map