fixed a few issues with kernelC; added examples with main functions

You might have noticed already, but I just found out that in the struct declaration of ```treeNode``` in kernelc programs, the field used to store value is actually declared as ```val```.