mapedit work

-better encapsulation support
-minor fixes
-work in progress