A lot of indentation and tab to space fixes
Nuking mysql as it is not needed by me
Improving functions and the way they are defined and how variables are passed to them
General code practices improvements