added fido_main.py, reorganized code to integrate with fsms