Refactoring for future Martini support

Also moving the example to a different directory.