Added locking and access function for RewindableMap, other minor changes to fix windows build.