Some minor refactoring. Also fixed a small issue with the copy action in our CellMLModelRepository plugin.