Update main function to export loops

The main function may now export loops or interactions. It will look to see if
there is a method with the correct name, and if so run it.