Command scanning

Encapsulate the app inside a class (so it is testeable) and simplify the scan algorithm.

Also, prepare the app to be extensible by accepting paths and namespaces as parameters for the command scanning.