Fix to_string() and add example.

First of all thank you for your excellent work on this project. I noticed that the `to_string()` method was not working. Looking at the function generated by `ctypesgen`, it expects a pointer to int for the second parameter, which is not being supplied by the python module.

This PR fixes the `to_string()` method and adds an example showing how it can be used to retrieve JSON-formatted strings from JX9 scripts.

I hope you will be able to merge this so I can get rid of my fork :)