F/add format cim template function


this is against f/assorted-changes-for-integration (which I have rebased about an hour ago). It adds the ability to create user-defined template functions from the configuration file, and at the same time creates an SCL macro which uses this feature, that formats messages according to the CIM specification, used by Kibana and Splunk.