Function invertMap

Create a new Map by inverting keys and values of specified map.