More refactoring, add map tool to scene editor (not done).