Refactor and add comments to broadcast variable example

While going over the docs for the 0.5 release, I felt the need to refactor our current broadcast variable example.

Since the examples also act as documentation, I've added some comments.