Improvements to the Swift code.
More plug-in work, this time on the main app.