Modularized bot.py for unittesting.