Clean up project a bit, pass structure from rust to python.

Also add comments to python source.