Auto Format Detection fix and adjustments

1. Fix for the deviation calculation
2. Some refactoring of code structure
3. Wizard changed to better handle layout errors when testing a class
4. Fix for Wizard was not displaying the auto generated class on show