[Refactoring] Add 'collapsed' and 'selected' as an attribute of node model

Move these attributes from scope to model. Status should be saved in model
not in scope.