Automated Discovery of Functional Actual Causes in Complex Environments