Clean up use of primitives.add in Sandcastle examples

Also moves the Sandcastle examples slightly closer to #2183.