Refactor example layout

We don't want to have to define the example code twice
in each example.

Also avoid hard-coding an access token.