Tidy up of main.cpp and usethe new modules::navigator to build modules
and loop over each module. I'm still having issues with root so I've
only been able to partially test this.
Add a method to the ModulesNavigator to get and cast a module in one go.
Replaced the implementation of ExportPulse::Instance() so it uses the
new modules::navigator class.