Corrected PiWriter to prevent NullPointerExceptions during serialization when there is no memory script or no refinement.
[Bugfix] Added a line to set selection on expressions when editing them, preventing the select all beahvior under ubuntu.
Merge branch 'UI-catch_unhandled_exceptions' into develop