fixing the example code

I could not get the example code in the readme to work. I put the example into its own file and modified it so it would work. I followed the code in the webapp project.

Also fixed a few typos in the readme.