Tidied up panel, put code into templates, sorted out callback to space port