More model refactor and added resource tree menu.

Model should no longer crash under any circumstances and flags are done
on a per item basis. Resource tree displays context menu with limited
functionality. Resource::Resource has been renamed to Resource::Content
to decrease ambiguity.