Refactored a few conditionals
More refactoring

Hope it's okay.
Small space changes and logic simplification
More refactoring
Small refactoring things
Line endings changed
New dll