add scheduler.py and move schedule run stuff there