Ported and scalafied GuiExporter.