Change Scanner to a struct.

Currently, the global map has to be modified. This leaves the user with
no way to revert to the original map.