Minor refactorings
Re-implement initial 'save' functionality for resources

This is only partially done, but is committed for the functionality.
There is a TODO for notifying the UI that the resource has been
successfully saved.