As far as I understand it is not possible to run an appex that lives inside the icloud folder. So I came to the idea of having a tiny appex wrapper script local that loads the main program from the icloud folder. The following code kinda works (not really):
from Documents import TheMainCode
But it has some nasty side effects. For example changing anything in the icloud file only has effect on the iOS device after a complete restart. And some variables seem to survive subsequent calls. Can someone please help me to understand what's happening here and if there is a working way of programmatically importing code from icloud?