Moving the logic into an inner class.

This is in preparation of resolving dependencies within "List<URL> all"
Resolving dependencies among other JPL files
defer MavenEmbedder creation
made this list configurable
a test case that reveals a bug in AtmostOneTaskExecutor
Fixing a bug.

pending was null as soon as task started running, so it was possible that another thread submits the task and have that executed while the first one was still running
adding assertion
trying to come up with a better representation. Not sure if I'm succeeding