Update advanced examples.

Updated the advanced examples, and reworked the internal cmake_helper
commands to make it easier to write the advanced examples.