Added settings to customize, which extensions should be considered as
Python files.
Also a little refactoring in code.