Use externs for publicly visible properties
Refactor undo
Remove obsolete exports
Add undo externs