Add the main driver function

The main driver function has been added that put everything together. It
can be invoked in the dummy script in the binary directory.