Changing code structure

Improve code structure
Separate categorization and folder handling
Added entry point to function
Missing dot in constant
Added opton to run from command line