make UnitScript::{ScriptToModel, ModelToScript} O(1) instead of linear