CFY-959 convert commands.sh to controller.py for cleaner code