fix dangling references

add TODOs
properly build up model structure
some deletions now work nicely
now removing does not crash anymore
add some TODOs
add some TODOs
Merge branch 'fix-broken-model'