add support for serializing and deserializing compiled templates