Import flux libraries inside tasks

Ran into the same problem. But this ticket helped:

The imports must appear on the very top of the task script, before option task = ...