Implement snippet testing infrastructure for the manual.

Made some snippets tested, need to work on others.