Michael,
Thanks a bunch!
My code almost worked as soon as I started doing
engine.openEnvironment();
:) It passed quite a few steps but failed in an event listener when i tried to get CommandService.
What finally made the trick was adding
<task-service />
<repository-service />
<command-service />
to cfg file.
Again, thanks a bunch!