Moved a huge load of functionality from MainFrame to Core.

The MainFrame is now GUI only. All Core methods are static.