Added support for serialising "classsimple" functions