Update demo code.

- Use the latest beta build for improved funcationality. Several bug
  fixes are included.
- Add helpful javadocs in the demo code. This helps people reviewing the
  demo understand what is going on within related methods.
- Add helpful inline comments to explain different parts, and the
  reasoning behind, of the code.