frontend: add persistence support to sml source

- add persister to SML
- minor tidy-ups in dia source
- add SML persistence support for frontend workflow
- tidy-up frontend workflow with functions, better variable/method
  naming  etc.