Map rework

This is working for me but additional testing would be appreciated.

I separated out the commits so it's hopefully a little clearer what I did.