Made MainApp a singleton, removed three classes from MainApp to simplify it, fixed a crash that can come from RateLimiter being terminated before the rest of the application through a sigint