General refactoring - rename connectionname to connection. remove type specific registration classes. Tidy up template replace/script execution handover