Rework tests to be actual tests rather than examples, so they can work on Windows too.