experimental struct_to_msg()

* still in main.c
* still has a small memory leak
* still has bugs