Restructuring to support tests / examples.