Perform import of Python modules in QDevice constructor

Integrate the import of Python modules into the constructor of the QDevice object to reduce computational overhead of the run function.

Edited by Matthias Möller