Fix: get rid of nested query loop, use libdogma for skill prerequisites.