Restructured main program loop asa LiveTrader class. PEP8 cleanup.