Lots of cleanup, basic implementation of maps working