Add main class and top level functionality.