Examples directory

Okay, I've moved the examples into an example directory and tried to update the tests so that it doesn't break.  I don't understand everything in the test script, though (specifically, what does gen_doc do? I can't really make it work), so some stuff may need to be fixed.