massive refactor, added an immutable model, updated ModelValueIds to use ModelSpec