move scanning code into a scan engine class

This allows to specialise this class into threaded and non-threaded
versions, for easier debugging, and safer usage.
better threads number capping
better variable names
proper method call syntax
useless import
add missing import
useless import
oops, fix module name
more inventory code in a dedicated engine class
more coherency in POD documentation
use a regular arrray
drop useless import
drop more useless import
add required import
restore lost comments
Merge branch 'master+use_threads_only_if_needed'